import request from '@/utils/request'

// 项目列表
export function projectList (query) {
  return request({
    url: '/project/list',
    method: 'get',
    params: query
  })
}
// 项目列表
export function listByPass (query) {
  return request({
    url: '/project/listByPass',
    method: 'get',
    params: query
  })
}
// 创建项目
export function createProject (data) {
  return request({
    url: '/project/create',
    method: 'post',
    data
  })
}
// 更新项目
export function updateProject (data) {
  return request({
    url: '/project/update',
    method: 'post',
    data
  })
}
// 项目详情
export function projectDetail (data) {
  return request({
    url: '/project/detail',
    method: 'post',
    data
  })
}
// 删除项目
export function deleteProject (data) {
  return request({
    url: '/project/delete',
    method: 'post',
    data
  })
}
// 删除项目时查验项目绑定的成果
export function projectAboutResult (data) {
  return request({
    url: '/project/getAboutResult',
    method: 'post',
    data
  })
}

// 提交
export function auditSubmit (query) {
  return request({
    url: '/audit/submit',
    method: 'get',
    params: query
  })
}

// 审核
export function auditPass (query) {
  return request({
    url: '/audit/pass',
    method: 'get',
    params: query
  })
}

// 退回
export function auditBackup (query) {
  return request({
    url: '/audit/backup',
    method: 'get',
    params: query
  })
}

// 列表展开下载文件
export function listDownloadFile (query) {
  return request({
    url: '/storage/downloadByFileName',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
// 详情页下载文件
export function detailDownloadFile (query) {
  return request({
    url: '/storage/downloadByFileSaveName/' + query.fileSaveName,
    method: 'get',
    responseType: 'blob'
  })
}

const uploadPath = process.env.VUE_APP_BASE_API + '/storage/upload'
export { uploadPath }
